package com.wh.wisdomsite.xbox.al.service.impl;

import com.baomidou.mybatisplus.mapper.SqlHelper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.wh.wisdomsite.xbox.al.dao.AlarmSignMapper;
import com.wh.wisdomsite.xbox.al.entity.AlarmSign;
import com.wh.wisdomsite.xbox.al.service.IAlarmSignService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author 刘旭
 * @version V1.0
 * @Package com.wh.wisdomsite.xbox.al.service.impl
 * @date 2018年08月09日 10:04
 * @Copyright 企业版权所有
 * @Company 贵州万华科技有限公司Copyright (c) 2018
 */
@Service("alarmSignService")
@Transactional(rollbackFor = {Exception.class,RuntimeException.class})
public class AlarmSignServiceImpl extends ServiceImpl<AlarmSignMapper, AlarmSign> implements IAlarmSignService {
    private static final Log logger = LogFactory.getLog(AlarmSignServiceImpl.class);

    @Autowired
    private AlarmSignMapper alarmSignMapper;

    @Override
    public List<String> getProjectIdByDeviceId(String deviceId) {
        return alarmSignMapper.getProjectIdByDeviceId(deviceId);
    }

    @Override
    public List<AlarmSign> getAlarmList(Wrapper<AlarmSign> wrapper) {
        return alarmSignMapper.getAlarmList(wrapper);
    }

    @Override
    public Page<Map<String, Object>> getMapsPage(Page page, Wrapper<AlarmSign> wrapper) {
        SqlHelper.fillWrapper(page, wrapper);
        page.setRecords(this.baseMapper.getMapsPage(page, wrapper));
        return page;
    }

    @Override
    public Map<String, Object> getMapById(Serializable id) {
        return alarmSignMapper.getMapById(id);
    }

    @Override
    public Map<String, Object> getAlarmNumber(Wrapper<AlarmSign> var1, String alarmStatus) {
        return alarmSignMapper.getAlarmNumber(var1,alarmStatus);
    }


}
